import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/childAccount/query',
    method: 'post',
    data
  })
}
export function queryPagestat(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/childAccount/queryUserUseSubAcc',
    method: 'post',
    data
  })
}

/**
 * 查询详情
 * @param {*} id
 */
export function get(subAcntTp) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/childAccount/get',
    method: 'get',
    params: { subAcntTp }
  })
}

/**
 * 添加
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/childAccount/insert',
    method: 'post',
    data
  })
}

/**
 * 编辑
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/childAccount/update',
    method: 'post',
    data
  })
}


